package com.linkdood.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkdood.app.domain.UserData;
import com.linkdood.app.mapper.UserDataMapper;
import com.linkdood.app.service.UserDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * 第三方信息接入用户附加信息
 *
 * @author hycao
 */
@Slf4j
@Service
public class UserDataServiceImpl extends ServiceImpl<UserDataMapper, UserData> implements UserDataService {

    @Override
    public Optional<UserData> getByUserId(String userId) {
        return lambdaQuery().eq(UserData::getUserId, userId).oneOpt();
    }

    @Override
    public UserData getUserDataByUserId(String userId) {
        return lambdaQuery().eq(UserData::getUserId, userId).one();
    }
}
